package com.xky.mybatis.service;

import com.xky.mybatis.dao.TestMapper;
import com.xky.mybatis.domain.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author keying.xia
 * @date 2017/12/8
 */
@org.springframework.stereotype.Service
public class Service {

    @Autowired
    private TestMapper testMapper;

    public int add (Test test){
        return testMapper.add(test.getId(),test.getName(),test.getAge());
    }

    public int delete(Integer id){
        return testMapper.delete(id);
    }

    public int update(Integer id,Test test){
        return testMapper.update(test.getName(),test.getAge(),id);
    }

    public Test getOne(Integer id){
        return testMapper.getOne(id);
    }

    public List<Test> getAll(){
        return testMapper.getAll();
    }



}
